<template>
  <ContentWrap>
    <el-collapse v-model="activeNames">
      <el-collapse-item name="basicInfo">
        <template #title>
          <span class="text-base font-bold">产品明细</span>
        </template>

        <el-descriptions :column="3">
          <el-descriptions-item label="所属客户">{{ product.customerName }}</el-descriptions-item>
          <el-descriptions-item label="所属品牌">{{ product.brandName }}</el-descriptions-item>
          <el-descriptions-item label="产品类别">{{ product.categoryName }}</el-descriptions-item>
          <el-descriptions-item label="产品规格">{{ product.dimension }}</el-descriptions-item>
          <el-descriptions-item label="库存数量">{{ product.price }}  <dict-tag :type="DICT_TYPE.CRM_PRODUCT_UNIT" :value="product.unit" /></el-descriptions-item>
        </el-descriptions>
        <el-descriptions :column="1">
          <el-descriptions-item label="产品介绍">{{ product.introduction }}</el-descriptions-item>
        </el-descriptions>
        <Editor  v-model="description" :height="300"  disabled="true"/>
      </el-collapse-item>
    </el-collapse>
  </ContentWrap>
</template>
<script setup lang="ts">
import { DICT_TYPE } from '@/utils/dict'
import * as ProductApi from '@/api/crm/product'

const { product } =  defineProps<{
  product: ProductApi.ProductVO
}>()
const description = computed(() => {
  return product.description;
});

// 展示的折叠面板
const activeNames = ref(['basicInfo'])
</script>
